from typenv import Env
from pydantic import BaseModel
from typing import Dict, Union, List
from dependencies import get_memory_id, MemoryHistory, authorize
from response import SuccessfulResponse, ErrorResponse
from mem0 import Memory
from mem0ai_config import vector_config, llm_config, embedding_config
from errors.exception import UnauthorizedException
from errors.handler import unauthorized_exception_handler, qdrant_client_unexpected_handler
from qdrant_client.http.exceptions import UnexpectedResponse

env = Env()
env.read_env()

m = Memory.from_config({
    "vector_store": vector_config,
    "llm": llm_config,
    "embedder": embedding_config
})

 

# Add a memory
m.add("I'm visiting Paris", user_id="john")

# Retrieve memories
memories = m.get_all(user_id="john")
print(memories)